package com.byjh.api;


import com.byjh.app.domain.News;
import com.byjh.app.dto.NewsSearchDto;
import com.byjh.app.service.IAppService;
import com.byjh.app.service.IBannerService;
import com.byjh.app.service.IChapterService;
import com.byjh.app.service.INewsService;
import com.byjh.common.annotation.Anonymous;
import com.byjh.common.core.domain.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/news")
public class NewsApi {


    @Resource
    private INewsService newsService;

    @GetMapping("/list")
    @Anonymous
    public R<List<News>> list(NewsSearchDto dto) {
        return R.ok(newsService.selectNewsList(new News().setTitle(dto.getKeyword())));
    }

}
